
Use NEXUS_DB

GO
--------------------------------------Insert---------------
CREATE PROC insertPlanDetail
	@PlanDetailName nvarchar(255) ,
	@PlanDetailPrice float ,
	@PlanDetailDescription nvarchar(500) ,
	@planID int 
AS
INSERT INTO  PlanDetail(PlanDetailName,PlanDetailPrice,PlanDetailDescription,planID) 
VALUES(@PlanDetailName,@PlanDetailPrice,@PlanDetailDescription,@planID) 

GO
---------------------------------------------------update-------------------
CREATE PROC updatePlanDetail
	@PlanDetailID int ,
	@PlanDetailName nvarchar(255) ,
	@PlanDetailPrice float ,
	@PlanDetailDescription nvarchar(500) ,
	@planID int 
AS
UPDATE PlanDetail SET	
	PlanDetailName =@PlanDetailName,
	PlanDetailPrice =@PlanDetailPrice,
	PlanDetailDescription =@PlanDetailDescription,
	planID =@planID
WHERE @PlanDetailID=PlanDetailID
GO
---------------------------------------Delete--------------------

CREATE PROC deletePlanDetail
	@PlanDetailID int
AS
	DELETE FROM PlanDetail WHERE PlanDetailID=@PlanDetailID
GO
-----------------------------------------getAll
CREATE PROC getAllPlanDetail
AS
SELECT * from PlanDetail
GO
-----------------------------------------getPlanDetailByPlanID
CREATE PROC getPlanDetailByPlanID
	@planID int
AS
SELECT * from PlanDetail Where planID=@planID
GO
--------------------------------getPlanDetailByID-----
CREATE PROC getPlanDetailByID
	@PlanDetailID int
AS
SELECT * from PlanDetail where PlanDetailID=@PlanDetailID


